﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:DataAccesLayer;assembly=DataAccesLayer"
    xmlns:presentation="clr-namespace:DataAccesLayer;assembly=DataAccesLayer"
    xmlns:system="clr-namespace:System;assembly=mscorlib"

  xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic"    
    xmlns:dg="http://schemas.microsoft.com/wpf/2008/toolkit"
         xmlns:thisVeryOne="clr-namespace:WpfApplicationExperimental"
    x:Class="WpfApplicationExperimental.Design3Experimental"       
    Title="eQual" Height="876" Width="1202" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Foreground="#FF204D89" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource DataGridHeaderBackgroundBrush}" ResizeMode="NoResize">
    <Window.Resources>

        <ObjectDataProvider x:Key="ListDynamicDataProvider" ObjectType="{x:Type thisVeryOne:DocumentsProvider}"/>
        <ObjectDataProvider x:Key="DataLayer" ObjectType="{x:Type local:EQualDataLayerFactory}"/>
        <ObjectDataProvider x:Key="listProvider" ObjectInstance="{StaticResource ListDynamicDataProvider}" MethodName="SetProvider">
            <ObjectDataProvider.MethodParameters>
                <x:Static Member="system:String.Empty"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
        <!-- 
        <ObjectDataProvider x:Key="DocumentDataProvider" ObjectType="{x:Type local:DocumentDataProvider}"/>
        <ObjectDataProvider x:Key="Documents" ObjectInstance="{StaticResource DocumentDataProvider}" MethodName="GetDocuments"/>
the customers datasource -->
        <!-- the orders datasource -->
        <ObjectDataProvider x:Key="EmployeeDataProvider" ObjectType="{x:Type thisVeryOne:EmployeesProvider}"/>
        <ObjectDataProvider x:Key="Employees" ObjectInstance="{StaticResource EmployeeDataProvider}" MethodName="GetEmploeesDocumentNotification">
            <ObjectDataProvider.MethodParameters>
                <x:Static Member="system:String.Empty"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>

        
        <SolidColorBrush x:Key="OutlookButtonForeground" Color="#FF204D89"/>

        <LinearGradientBrush x:Key="OutlookButtonBackground" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFD9EDFF" Offset="0"/>
            <GradientStop Color="#FFC0DEFF" Offset="0.445"/>
            <GradientStop Color="#FFC0D9FB" Offset="1"/>
            <GradientStop Color="#FFAFD1F8" Offset="0.53"/>
        </LinearGradientBrush>

        <LinearGradientBrush x:Key="OutlookButtonHighlight" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFFFBD69" Offset="0"/>
            <GradientStop Color="#FFFFB75A" Offset="0.0967"/>
            <GradientStop Color="#FFFFB14C" Offset="0.2580"/>
            <GradientStop Color="#FFFB8C3C" Offset="0.3870"/>
            <GradientStop Color="#FFFEB461" Offset="0.9677"/>
            <GradientStop Color="#FFFEBB67" Offset="1"/>
        </LinearGradientBrush>

        <Style x:Key="OutlookTabControlStyle" TargetType="{x:Type TabControl}">
            <Setter Property="Foreground" Value="{DynamicResource OutlookButtonForeground}"/>
            <Setter Property="Background" Value="{DynamicResource OutlookButtonBackground}"/>
            <Setter Property="BorderBrush" Value="{x:Static Microsoft_Windows_Themes:ClassicBorderDecorator.ClassicBorderBrush}"/>
            <Setter Property="BorderThickness" Value="3"/>
            <Setter Property="Margin" Value="0"/>
            <Setter Property="Padding" Value="1"/>
            <Setter Property="MinWidth" Value="10"/>
            <Setter Property="MinHeight" Value="10"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TabControl}">
                        <Grid ClipToBounds="true" SnapsToDevicePixels="true"
                      KeyboardNavigation.TabNavigation="Local">
                            <Grid.RowDefinitions>
                                <RowDefinition x:Name="RowDefinition0" Height="100"/>
                                <RowDefinition x:Name="RowDefinition1" Height="*"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition x:Name="ColumnDefinition0"/>
                                <ColumnDefinition x:Name="ColumnDefinition1" Width="0"/>
                            </Grid.ColumnDefinitions>
                            <Grid x:Name="ContentPanel" Grid.Column="0" Grid.Row="1"
                        KeyboardNavigation.DirectionalNavigation="Contained"
                        KeyboardNavigation.TabIndex="2"
                        KeyboardNavigation.TabNavigation="Local">
                                <Microsoft_Windows_Themes:ClassicBorderDecorator
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderStyle="Raised"
                        BorderThickness="{TemplateBinding BorderThickness}">
                                    <ContentPresenter SnapsToDevicePixels=
                            "{TemplateBinding SnapsToDevicePixels}" Margin="2,2,2,2"
                            x:Name="PART_SelectedContentHost"
                            ContentSource="SelectedContent"/>
                                </Microsoft_Windows_Themes:ClassicBorderDecorator>
                            </Grid>
                            <StackPanel HorizontalAlignment="Stretch" Margin="0,-2,0,0"
                    x:Name="HeaderPanel" VerticalAlignment="Bottom" Width="Auto" 
                Height="Auto" Grid.Row="1" IsItemsHost="True"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="TabStripPlacement" Value="Bottom">
                                <Setter Property="Grid.Row"
                        TargetName="ContentPanel" Value="0"/>
                                <Setter Property="Height"
                            TargetName="RowDefinition0" Value="*"/>
                                <Setter Property="Height"
                            TargetName="RowDefinition1" Value="Auto"/>
                            </Trigger>
                            <Trigger Property="TabStripPlacement" Value="Left">
                                <Setter Property="Grid.Row"
                            TargetName="ContentPanel" Value="0"/>
                                <Setter Property="Grid.Column"
                            TargetName="ContentPanel" Value="1"/>
                                <Setter Property="Width"
                            TargetName="ColumnDefinition0" Value="Auto"/>
                                <Setter Property="Width"
                            TargetName="ColumnDefinition1" Value="*"/>
                                <Setter Property="Height"
                            TargetName="RowDefinition0" Value="*"/>
                                <Setter Property="Height"
                            TargetName="RowDefinition1" Value="0"/>
                            </Trigger>
                            <Trigger Property="TabStripPlacement" Value="Right">
                                <Setter Property="Grid.Row"
                            TargetName="ContentPanel" Value="0"/>
                                <Setter Property="Grid.Column"
                            TargetName="ContentPanel" Value="0"/>
                                <Setter Property="Width"
                            TargetName="ColumnDefinition0" Value="*"/>
                                <Setter Property="Width"
                            TargetName="ColumnDefinition1" Value="Auto"/>
                                <Setter Property="Height"
                            TargetName="RowDefinition0" Value="*"/>
                                <Setter Property="Height"
                            TargetName="RowDefinition1" Value="0"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground"
                            Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="OutlookTabItemStyle" TargetType="{x:Type TabItem}">
            <Setter Property="Padding" Value="12,2,12,2"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TabItem}">
                        <Border SnapsToDevicePixels="true" x:Name="Bd"
                    Background="{TemplateBinding Background}"
                    BorderThickness="1" BorderBrush="#FF6593CF">
                            <ContentPresenter SnapsToDevicePixels=
                        "{TemplateBinding SnapsToDevicePixels}"
                        Margin="{TemplateBinding Padding}"
                VerticalAlignment="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"
                ContentSource="Header" RecognizesAccessKey="True"
                            HorizontalAlignment="Left"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="Selector.IsSelected" Value="True">
                                <Setter Property="Background" TargetName="Bd"
                Value="{DynamicResource OutlookButtonHighlight}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!--this is a ListView Style -->
        <Style x:Key="ItemContStyle" TargetType="{x:Type ListViewItem}">
            <Style.Resources>
                <LinearGradientBrush x:Key="ProfitBrush" StartPoint="0.5,0" EndPoint="0.5,1">
                    <GradientStop Offset="0.1" Color="#AA00CC00" />
                    <GradientStop Offset="0.8" Color="#55008800" />
                </LinearGradientBrush>
                <LinearGradientBrush x:Key="LossBrush" StartPoint="0.5,0" EndPoint="0.5,1">
                    <GradientStop Offset="0.1" Color="#AACC0000" />
                    <GradientStop Offset="0.8" Color="#55880000" />
                </LinearGradientBrush>
            </Style.Resources>

            <!-- Stretch the content so that we can right-align values 
           in the Balance column. -->
            <Setter Property="HorizontalContentAlignment" Value="Stretch" />

            <Style.Triggers>

            </Style.Triggers>
        </Style>
        <SolidColorBrush x:Key="textbrush" Color="#FF204D89"/>
    </Window.Resources>
    <Grid Name="grid1" TextElement.Foreground="#FF204D89">
    	<Grid.Background>
    		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    			<GradientStop Color="#FF000000" Offset="0"/>
    			<GradientStop Color="#FFFFFFFF" Offset="1"/>
    		</LinearGradientBrush>
    	</Grid.Background>
    	<Grid.ColumnDefinitions>
    		<ColumnDefinition Width="0.222*"/>
    		<ColumnDefinition Width="0.658*"/>
    		<ColumnDefinition Width="0.12*"/>
    	</Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Name="MainHeader" Height="Auto" MinHeight="77.472" />
            <RowDefinition Name="Contents" Height="Auto" MinHeight="66.528" />
            <RowDefinition Height="Auto" MinHeight="0"/>
            <RowDefinition Height="Auto" MinHeight="586.001"/>
        </Grid.RowDefinitions>

        <TabControl BorderBrush="{x:Null}" BorderThickness="{DynamicResource BorderThikness}" Name="MainOutlookControl" Style="{DynamicResource OutlookTabControlStyle}" TabStripPlacement="Bottom" Grid.Row="1" Background="{x:Null}" Grid.RowSpan="3" Margin="1.486,0,-1.486,75.15">
            <TabItem Background="{x:Null}" Foreground="{DynamicResource textbrush}" Header="Έγγραφα" Height="30" MouseDown="TabItem_MouseDown" Style="{DynamicResource OutlookTabItemStyle}">
                <Grid Background="{x:Null}">
                    <TreeView BorderBrush="{x:Null}" ClipToBounds="False" FontSize="11" Foreground="#FF204D89" HorizontalAlignment="Left" Margin="17,24,0,31" Name="documentstreeview" Opacity="1" SelectedItemChanged="treeView1_SelectedItemChanged" Width="320" Background="{x:Null}">
                        <TreeView.Resources>
                            <ResourceDictionary Source="Resources/GroupedTreeViewItemStyle.xaml" />
                        </TreeView.Resources>
                    </TreeView>
                </Grid>
            </TabItem>
            <TabItem Header="Προσωπικό" Height="30" MouseDown="TabItem_MouseDown_1" MouseLeftButtonDown="TabItem_MouseLeftButtonDown" Style="{DynamicResource OutlookTabItemStyle}" BorderBrush="#FF090F1B" FontWeight="Normal" FontSize="11" FontFamily="Tahoma" Background="{x:Null}" Foreground="{DynamicResource textbrush}">
                <Grid Background="{x:Null}">
                    <TreeView Background="{x:Null}" BorderBrush="{x:Null}" FontSize="12" Foreground="#FF204D89" Margin="17,24,17,31" Name="personeltreeview" SelectedItemChanged="personeltreeview_SelectedItemChanged">
                        <TreeView.Resources>
                            <ResourceDictionary Source="Resources/GroupedTreeViewItemStyle.xaml" />
                        </TreeView.Resources>
                    </TreeView>
                </Grid>
            </TabItem>
            <TabItem Background="{x:Null}" Foreground="{DynamicResource OutlookButtonForeground}" Header="Διορθωτικες Προληπτικες Ενέργειες" Height="30" Style="{DynamicResource OutlookTabItemStyle}">
                <Grid>
                    <TreeView Background="{x:Null}" BorderBrush="{x:Null}" ClipToBounds="True" FontSize="12" Foreground="#FF204D89" Margin="10,10,24,24" Name="projectsTreeView">
                        <TreeView.Resources>
                            <ResourceDictionary Source="Resources/GroupedTreeViewItemStyle.xaml" />
                        </TreeView.Resources>
                    </TreeView>
                </Grid>
            </TabItem>
            <TabItem Background="{x:Null}" Foreground="{DynamicResource OutlookButtonForeground}" Header="Απολογισμός Βελτιώσεις" Height="30" Style="{DynamicResource OutlookTabItemStyle}">
                <Grid>
                    <TreeView Background="{x:Null}" BorderBrush="{x:Null}" FontSize="12" Foreground="#FF204D89" Margin="10,10,24,29" Name="failuresTreeView">
                        <TreeView.Resources>
                            <ResourceDictionary Source="Resources/GroupedTreeViewItemStyle.xaml" />
                        </TreeView.Resources>
                    </TreeView>
                </Grid>
            </TabItem>
            <TabItem Background="{x:Null}" Foreground="{DynamicResource textbrush}" Header="προμήθειες" Height="30" Style="{DynamicResource OutlookTabItemStyle}">
                <Grid>
                    <TreeView Background="{x:Null}" BorderBrush="{x:Null}" FontSize="12" Foreground="#FF204D89" Margin="10,10,24,24" Name="suppliesTreeView">
                        <TreeView.Resources>
                            <ResourceDictionary Source="Resources/GroupedTreeViewItemStyle.xaml" />
                        </TreeView.Resources>
                    </TreeView>
                </Grid>
            </TabItem>
        </TabControl>
        <my:DocumentDetailedControl Grid.Row="1" Margin="0,39.149,1.68,0" x:Name="documentDetailedControl1" xmlns:my="clr-namespace:WpfApplicationExperimental.DetailedControls" Visibility="Hidden" HorizontalAlignment="Right" Width="383.78" Grid.Column="1" Grid.ColumnSpan="2" Height="104" VerticalAlignment="Top" />
       
        <Label Style="{DynamicResource SimpleLabel}" Content="eQual" Background="{DynamicResource DarkBrownBrush}" FontSize="72" x:Name="Logo" HorizontalAlignment="Left">
        	<Label.LayoutTransform>
        		<TransformGroup>
        			<ScaleTransform ScaleX="1" ScaleY="1"/>
        			<SkewTransform AngleX="-20" AngleY="0"/>
        			<RotateTransform Angle="0"/>
        			<TranslateTransform X="0" Y="0"/>
        		</TransformGroup>
        	</Label.LayoutTransform>
        	<Label.Foreground>
        		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        			<GradientStop Color="#FF000000" Offset="0"/>
        			<GradientStop Color="#FF86AAC0" Offset="0.116"/>
        		</LinearGradientBrush>
        	</Label.Foreground>
        </Label>
        <DockPanel Margin="1.98,57,243.02,-239.001" Grid.Column="1" Grid.RowSpan="2" Name="maindock" Grid.Row="1">
<!-- ItemsSource="{Binding Source={StaticResource Documents}}"-->
            <dg:DataGrid AutoGenerateColumns="False"   BorderBrush="{x:Null}"   Foreground="#FFF5F5F5" GridLinesVisibility="All"  x:Name="MainGridView" SelectedValuePath="CustomerID" SelectionChanged="CustomerGrid_SelectionChanged" SelectionMode="Extended" SelectionUnit="FullRow" Style="{DynamicResource DataGridDemoStyle}" Background="{x:Null}" d:LayoutOverrides="GridBox" KeyDown="MainGridView_KeyDown" RowEditEnding="MainGridView_RowEditEnding" Width="524" Height="324.906666666667" FontWeight="Bold" PreviewMouseLeftButtonDown="MainGridView_PreviewMouseLeftButtonDown" MouseRightButtonDown="MainGridView_MouseRightButtonDown" >
                <dg:DataGrid.Columns>

                    <dg:DataGridTemplateColumn Header="Attachment" MinWidth="100">

                        <dg:DataGridTemplateColumn.CellEditingTemplate>
                            <DataTemplate>

                                <thisVeryOne:AttachmentControl  Attachment="{Binding Attachment1}" OnAttachmentChanged="AttachmentControl_OnAttachmentChanged" />

                            </DataTemplate>
                        </dg:DataGridTemplateColumn.CellEditingTemplate>
                        <dg:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=Attachment1.Name  , StringFormat=d}" />
                            </DataTemplate>
                        </dg:DataGridTemplateColumn.CellTemplate>
                    </dg:DataGridTemplateColumn>
                </dg:DataGrid.Columns>
            </dg:DataGrid>
            <!-- ItemsSource="{Binding Source={StaticResource Documents}}"--><!--ItemsSource="{Binding Source={StaticResource Documents}}"   AutoGenerateColumns="True" -->
        </DockPanel>
        <Path HorizontalAlignment="Right" Margin="0,8,243.56,-27.85" Width="1.5" Fill="#FF080101" Stretch="Fill" Stroke="#FF000000" Grid.Column="1" Grid.RowSpan="4" Data="M800,8 L799.5,743.5"/>
        <Rectangle Margin="0,-2,1.68,0" Name="rectangle1" Stroke="Black" Height="89" VerticalAlignment="Top" Fill="AntiqueWhite" Opacity="0.3" RadiusX="0" RadiusY="0" OverridesDefaultStyle="True" Grid.ColumnSpan="3" />
        <dg:DataGrid AutoGenerateColumns="True"   Background="{x:Null}" BorderBrush="{x:Null}" Foreground="#FFF9F9FB" GridLinesVisibility="All" ItemsSource="{Binding Source={StaticResource Employees}}" Margin="-245.06,303.137,3.18,0" Name="dataGrid2" SelectionMode="Extended" SelectionUnit="FullRow" Style="{DynamicResource DataGridDemoStyle}" Grid.Column="2" Height="147" Grid.Row="3" VerticalAlignment="Top" FontWeight="Bold" RowEditEnding="dataGrid2_RowEditEnding" />
        <dg:DataGrid AutoGenerateColumns="True" BorderBrush="{x:Null}" Foreground="#FFF3F2F2" GridLinesVisibility="All" ItemsSource="{Binding Source={StaticResource Employees}}" Name="Employeegrid" SelectionMode="Extended" SelectionUnit="FullRow" Style="{DynamicResource DataGridDemoStyle}" Background="{x:Null}" Margin="-245.06,73.851,1.68,0" Grid.Column="2" Height="156" Grid.Row="3" VerticalAlignment="Top" FontWeight="Bold" SelectionChanged="Employeegrid_SelectionChanged" RowEditEnding="Employeegrid_RowEditEnding" />
        <Path HorizontalAlignment="Left" Margin="0.486,2.528,0,-27.85" Width="1" Fill="{DynamicResource BorderBrush}" Stretch="Fill" Stroke="Black" Grid.Column="1" Grid.Row="1" Grid.RowSpan="3" Data="M264,80 L264,744"/>
       
        <Rectangle Margin="0,-2,-1.486,0" Stroke="Black" RadiusX="0" RadiusY="0" Opacity="0.3">
        	<Rectangle.Fill>
        		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        			<GradientStop Color="#FF000000" Offset="0"/>
        			<GradientStop Color="#FF0D6BF5" Offset="1"/>
        		</LinearGradientBrush>
        	</Rectangle.Fill>
        </Rectangle>
        <Menu Height="22" Name="menu1" VerticalAlignment="Top" Grid.ColumnSpan="3" Background="{DynamicResource DataGridBackgroundBrush}" Foreground="#FF204D89" Opacity="0.3">
            <MenuItem Header="File" Click="MenuItem_Click_3" Width="28.553" Height="19.277" Background="{DynamicResource DataGridBackgroundBrush}" >
                
            	<MenuItem Header="New" Background="{DynamicResource DataGridBackgroundBrush}"/>
            	<MenuItem Header="Open" Background="{DynamicResource DataGridBackgroundBrush}"/>
            	<MenuItem Header="Save As" Width="61.887" Height="17.277" Background="{DynamicResource DataGridBackgroundBrush}"/>
            	<MenuItem Header="Save" Background="{DynamicResource DataGridBackgroundBrush}"/>
                
                </MenuItem> 
        	<MenuItem Width="30.443" Height="19.277" Header="Edit"/>
        	<MenuItem Width="0" Height="0" Header="View"/>
        	<MenuItem Header="Window" Width="Auto" Height="Auto" Click="MenuItem_Click_4">
        		<MenuItem Header="MenuItem" Background="{DynamicResource DataGridBackgroundBrush}"/>
        	</MenuItem>
        	<MenuItem Header="Help" Width="35.03" Height="19.277"/> 
        </Menu>
        <Label Name="formsLabel" Margin="-245.06,255.137,3.18,286.864" Content="Label" Grid.Column="2" Grid.Row="3" Foreground="#FFF7EAEA" FontSize="16"/>
        <Label Name="employeeLabel" Margin="-245.06,29.851,1.68,0" Content="Label" Grid.Column="2" Grid.Row="3" VerticalAlignment="Top" Height="44" FontSize="16" Foreground="#FFFDF3F3"/>
        <Label Name="mainLabel" Margin="0,0,249.06,91.149" Content="Label" VerticalAlignment="Bottom" Height="44" Grid.Column="1" Grid.Row="1" d:LayoutOverrides="VerticalAlignment" Width="523.986" HorizontalAlignment="Right" Foreground="#FFFFFDFD" FontSize="16"/>
    </Grid>
</Window>
